
<?php
/**
 * 使用了增改删查的model ＋ model中进行了get传参（post也可以）
 * 注意：get post 赋值过程应该写在model中？让控制器代码尽量短小
 */
// 访问地址：http://192.168.33.10/CI/index.php/_demo4/select

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class _Demo4 extends CI_Controller {
	
	
	public function test(){
		$this->load->model('user_model');
		$arr = array('name'=>'test');
		$id = $this->user_model->test();
		print_r($id);
	}
	
	public function insert(){
		$this->load->model('demo4');
		$arr = array('name'=>'test');
		$id = $this->demo4->client_insert($arr);
		echo $id;
	}

	public function update(){
		$this->load->model('demo4');
		$arr = array('usid'=>22,'uname'=>'deng222','upass'=>'1233333');
		$this->demo4->client_update(2,$arr);
	}

	public function delete(){
		$this->load->model('demo4');
		$this->demo4->client_delete(22);
	}

	public function select()
	{
		$this->load->model('demo4');
		$arr = $this->demo4->client_select(14);
		print_r($arr);
		echo $arr[0]->id;

	}
	
	
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */